﻿#pragma once

#include "../MirEnvir/Envir.h"
#include <vector>
#include <any>

using namespace Server::MirEnvir;

namespace Server::MirObjects
{
    enum class DelayedType
    {
        Magic,
        /// <summary>
        /// Param0 MapObject (Target) | Param1 Damage | Param2 Defence | Param3 damageWeapon | Param4 UserMagic | Param5 FinalHit
        /// </summary>
        Damage,
        RangeDamage,
        Spawn,
        Die,
        Recall,
        MapMovement,
        Mine,
        NPC,
        Poison,
        DamageIndicator
    };

    class DelayedAction
    {
    protected:
        static Server::MirEnvir::Envir *getEnvir();

    public:
        DelayedType Type = static_cast<DelayedType>(0);
        long long Time = 0;
        long long StartTime = 0;
        std::vector<std::any> Params;

        bool FlaggedToRemove = false;

        DelayedAction(DelayedType type, long long time, std::vector<std::any> &p);
    };
}
